import request from '@/utils/request'
import {appConfig} from "../../config/app";

let service = appConfig.microServModules.system + 'api/permission'
let mallService = appConfig.microServModules.system + '/api/portalSetting'

export function del(data) {
  return request(`${service}/delete`, {method: 'get', data: data})
}

export function add(data) {
  return request(`${service}/add`, {method: 'post', data: data})
}

export function update(data) {
  return request(`${service}/update`, {method: 'post', data: data})
}

export function qryAllPermission(data) {
  return request(`${service}/qryAllPermission`, {method: 'get', data: data})
}

// 根据角色id查询权限及全部权限
export function qryAllPermByRoleId(data) {
  return request(`${service}/qryAllPermByRoleId`, {method: 'get', data: data})
}

// 根据角色id查询权限及全部权限
export function qryAllPermByRoleIdAndUserCode(data) {
  return request(`${service}/qryAllPermByRoleIdAndUserCode`, {method: 'get', data: data})
}

// 根据角色id查询商城配置
export function getSetting(data) {
  return request(`${mallService}/getSetting`, {method: 'get', data: data})
}
